package com.example.util;

import com.example.account.R;
import com.example.accounts.Pay_ListActivity;

import android.content.Context;
import android.database.Cursor;
import android.support.v4.widget.CursorAdapter;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView.FindListener;
import android.widget.TextView;

public class MyCursorAdapter extends CursorAdapter {

	public MyCursorAdapter(Context context, Cursor c, int flags) {
		super(context, c, flags);
		// TODO Auto-generated constructor stub
	}
	public View newView(Context arg0, Cursor arg1, ViewGroup arg2) {
		View view=LayoutInflater.from(arg0).inflate(R.layout.list_item, null);
		return view;
	}
	public void bindView(View arg0, Context arg1, Cursor arg2) {
		// TODO Auto-generated method stub
		TextView list_time=(TextView) arg0.findViewById(R.id.list_time);
		TextView list_category=(TextView) arg0.findViewById(R.id.list_category);
		TextView list_money=(TextView) arg0.findViewById(R.id.list_money);
		list_time.setText(arg2.getString(arg2.getColumnIndex("timepay")));
		list_category.setText(arg2.getString(arg2.getColumnIndex("categorypay")));
		list_money.setText(arg2.getString(arg2.getColumnIndex("moneypay")));
	}

}
